//
//  mmjMeSquareButton.m
//  Social
//
//  Created by seirra on 2018/5/17.
//  Copyright © 2018年 mmj. All rights reserved.
//

#import "mmjMeSquareButton.h"

@implementation mmjMeSquareButton
-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:15];
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage imageNamed:@"mainCellBackground"] forState:UIControlStateNormal];
        
    }
    
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    self.imageView.mmj_y = self.mmj_height * 0.2;
    self.imageView.mmj_height = self.mmj_height*0.5;
    self.imageView.mmj_width = self.imageView.mmj_height;
    self.imageView.mmj_centerX= self.mmj_width*0.5;
    
    
    self.titleLabel.mmj_x = 0;
    self.titleLabel.mmj_y = self.imageView.mmj_bottom;
    self.titleLabel.mmj_width = self.mmj_width;
    self.titleLabel.mmj_height =self.mmj_height-self.titleLabel.mmj_y;
    
}

@end
